// 引入插件，处理Cookies 中获取的字符串数据
import Cookies from 'js-cookie'

// 设置存储的token 名
const TokenKey = 'hrsaas-ihrm-token'

// 获取token
export function getToken() {
  return Cookies.get(TokenKey)
}

// 添加token
export function setToken(token) {
  return Cookies.set(TokenKey, token, { expires: 1 })
}

// 清除token
export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 设置时间戳
const TimeOutKey = 'hrsaas-timeout-key'

// 获取token
export function getTimeOutKey() {
  return Cookies.get(TimeOutKey)
}

// 添加token
export function setTimeOutKey(date) {
  return Cookies.set(TimeOutKey, date)
}
